from redis import Redis
class Rediscon:
    def __init__(self):
        self.r=Redis(host='localhost',port=6379,db=1)
    # 存入数据
    def insertdata(self,key,value):
        self.r.sadd(key,*value)
    # 取数据
    def getdata(self,key):
        res=self.r.smembers(key)
        if res:
            return res
        else:
            return None
r=Rediscon()